package com.clinic.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.PrimaryKeyJoinColumn;

@Entity
@PrimaryKeyJoinColumn(name = "cs_obj_id")
public class Clinic_leaves extends Super_type {

	private static final long serialVersionUID = 1L;

	@Column(insertable = false, updatable = false)
	private int cs_obj_id;
	@Column(nullable = true)
	private boolean is_group_clinic;
	private int dr_obj_id;
	private Date date_frm;
	private Date date_to;
	@Column(length = 32)
	private String leave_status;
	@Column(length = 256)
	private String leave_reason;
	@Column(length = 1024)
	private String leave_desc;
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "cc_obj_id", nullable = false)
	private Clinic clinic;

	public Clinic_leaves() {
		super();
	}

	public Clinic_leaves(String obj_owner_name, boolean is_group_clinic,
			int dr_obj_id, Date date_frm, Date date_to, String leave_status,
			String leave_reason, String leave_desc) {
		super(obj_owner_name);
		this.is_group_clinic = is_group_clinic;
		this.dr_obj_id = dr_obj_id;
		this.date_frm = date_frm;
		this.date_to = date_to;
		this.leave_status = leave_status;
		this.leave_reason = leave_reason;
		this.leave_desc = leave_desc;
	}

	public Clinic_leaves(String obj_owner_name, boolean is_group_clinic,
			int dr_obj_id, Date date_frm, Date date_to, String leave_status,
			String leave_reason, String leave_desc, Clinic clinic) {
		super(obj_owner_name);
		this.is_group_clinic = is_group_clinic;
		this.dr_obj_id = dr_obj_id;
		this.date_frm = date_frm;
		this.date_to = date_to;
		this.leave_status = leave_status;
		this.leave_reason = leave_reason;
		this.leave_desc = leave_desc;
		this.clinic = clinic;
	}

	public Clinic getClinic() {
		return clinic;
	}

	public int getCs_obj_id() {
		return cs_obj_id;
	}

	public boolean isIs_group_clinic() {
		return is_group_clinic;
	}

	public void setIs_group_clinic(boolean is_group_clinic) {
		this.is_group_clinic = is_group_clinic;
	}

	public int getDr_obj_id() {
		return dr_obj_id;
	}

	public void setDr_obj_id(int dr_obj_id) {
		this.dr_obj_id = dr_obj_id;
	}

	public Date getDate_frm() {
		return date_frm;
	}

	public void setDate_frm(Date date_frm) {
		this.date_frm = date_frm;
	}

	public Date getDate_to() {
		return date_to;
	}

	public void setDate_to(Date date_to) {
		this.date_to = date_to;
	}

	public String getLeave_status() {
		return leave_status;
	}

	public void setLeave_status(String leave_status) {
		this.leave_status = leave_status;
	}

	public String getLeave_reason() {
		return leave_reason;
	}

	public void setLeave_reason(String leave_reason) {
		this.leave_reason = leave_reason;
	}

	public String getLeave_desc() {
		return leave_desc;
	}

	public void setLeave_desc(String leave_desc) {
		this.leave_desc = leave_desc;
	}

	@Override
	public void _toString() {
		System.out.println("Enter - _toString");
		super._toString();
		System.out.println("dr_obj_id: " + this.dr_obj_id + "\nleave desc: "
				+ this.leave_desc + "\nleave reason: " + this.leave_reason
				+ "\nleave status: " + this.leave_status + "\ndate from: "
				+ this.date_frm + "\ndate to: " + this.date_to
				+ "\nis group clinic: " + this.is_group_clinic
				+ "\nclinic ID: " + this.clinic.getCc_obj_id());
		System.out.println("Exit - _toString");
	}
}